<template>
  <d2-container>

      <!-- 搜索框 -->
      <el-input
        v-model="input"
        placeholder="请输入内容"
        class="inputBox"
      ></el-input>
      <el-button type="button" class="botton_souch">搜索 </el-button>

      <!-- 选择器 -->
      <el-select
        v-model="value"
        clearable
        placeholder="请选择"
        class="selector"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>

    <!-- \按钮 -->

      <el-button type="button" @click="open">查看</el-button>
      <!-- <el-button type="button">删除 </el-button>
      <el-button type="button">更多操作</el-button> -->

      <!-- table -->
      <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>

        <el-table-column prop="dept" label="部门" width="150">
          <div slot-scope="scope">{{ scope.row.date }}</div>
        </el-table-column>
        <el-table-column
          prop="Theassessment_name"
          label="考核种类"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="assessType"
          label="考核类型"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column prop="examince" label="被考核人" show-overflow-tooltip>
        </el-table-column>
        <el-table-column
          prop="create_time"
          label="考核日期"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="score"
          label="得分"
          show-overflow-tooltip
          sortable
        >
        </el-table-column>
        <!-- <el-table-column prop="ranking" label="排名" show-overflow-tooltip>
        </el-table-column> -->
        <el-table-column
          prop="create_time"
          label="创建时间"
          show-overflow-tooltip
          sortable
        >
        </el-table-column>
        <el-table-column label="操作">
          <div slot-scope="scope">
            <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
              >查看</el-button
            >
            <!-- <el-button
          size="mini"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)">删除</el-button> -->
          </div>
        </el-table-column>
        <!-- <el-table-column prop="operition" label="操作" show-overflow-tooltip>
        </el-table-column> -->
      </el-table>
      <!-- <div style="margin-top: 20px">
    <el-button @click="toggleSelection([tableData[1], tableData[2]])">切换第二、第三行的选中状态</el-button>
    <el-button @click="toggleSelection()">取消选择</el-button>
  </div> -->

      <!-- 分页 -->
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
        >
        </el-pagination>
      </div>
      <!-- <el-pagination
  background
  layout="prev, pager, next"
  :total="1000">
</el-pagination> -->

    </d2-container >
</template>

<script>
// export default {
//   name: 'page1'
// }
//
</script>

<style>
.block {
  float: right;
}

.inputBox {
  width: 25%;
}

.botton_souch {
  margin-left: 2%;
}

.selector {
  margin-left: 5%;
}
</style>

// 组件js
<script>
export default {
  data() {
    return {
      //搜索框
      input: "",

      // 选择器
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      value: "",

      // table
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
          operition: "删除|修改",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      multipleSelection: [],
    };
  },

  //分页
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
  },
};
</script>
